import { Component, OnInit } from '@angular/core';
import { NavController } from '@ionic/angular';
import { Storage } from '@ionic/storage';
import { ConfigService } from 'src/app/service/config.service';
import { ToolService } from 'src/app/service/tool.service';

@Component({
  selector: 'app-noticedetail',
  templateUrl: './noticedetail.page.html',
  styleUrls: ['./noticedetail.page.scss'],
})
export class NoticedetailPage implements OnInit {
  public noticeDatail={"title":'',"content":""};
  constructor(private navCtrl:NavController,private store:Storage) { }

  ngOnInit() {
      this.getStoreData();
  }
  /**
   * 获取缓存的公告的详细信息
   */
  async getStoreData(){
    let that=this;
      await this.store.get(ConfigService.NOTICEDETAIL).then((data)=>{
          if(!ToolService.isEmpty(data)){
              that.noticeDatail=data;
          }else{
            that.noticeDatail={"title":'',"content":""};
          }
      });
  }

  backClick(){
      this.navCtrl.navigateBack("/notice");
  }

}
